/*
 * thread.h
 *
 * Definition of thread.
 *
 *  Created on: 13.01.2013
 *      Author: Michael
 */

#ifndef THREAD_H_
#define THREAD_H_

/*
 * ======== Standard includes ========
 */
#include <inttypes.h>
#include <setjmp.h>

/*
 * ======== Project related includes ========
 */
#include "os/api.h"

/*
 * Definition of a thread state.
 */
typedef enum {
	THREAD_INVALID,
	THREAD_RUNNING,
	THREAD_READY
} State_t;

typedef enum {
	PRIORITY_LOW,
	PRIORITY_MEDIUM,
	PRIORITY_HIGH
} Priority_t;

/*
 * Definition of a single thread.
 */
typedef struct {
	uint16_t id;
	State_t state;
	Priority_t priority;
	jmp_buf context;
	thread_func run;
} Thread_t;

#endif /* THREAD_H_ */
